<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渲染柱形图案例</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            display: flex;
            width: 700px;
            height: 500px;
            border-left: 1px solid rgb(255, 222, 192);
            border-bottom: 1px solid rgb(255, 217, 192);
            margin: 50px auto;
            justify-content: space-between;
            align-items: flex-end;
            text-align: center;
        }

        .box>div {
            display: flex;
            width: 50px;
            background-color: rgb(130, 197, 128);
            background-color: blue;
            flex-direction: column;
            justify-content: space-between;
        }

        .box div span {
            margin-top: -25px;
        }

        .box div h4 {
            margin-bottom: -35px;
            width: 70px;
            margin-left: -10px;
        }
    </style>
</head>

<body>

    <script>
        let arr = [];
        for (let index = 1; index < 5; index++) {
            arr.push(prompt(`请输入第${index}季度数据`));
        }
        document.write(`<div class="box">`)
        for (let index = 0; index < arr.length; index++) {
            document.write(`<div style="height: ${arr[index]}px;">
                <span>${arr[index]}</span>
                <h4>第${index + 1}季度</h4>
            </div>`)
        }
        document.write(` </div>`)
        console.log(arr);
    </script>
</body>

</html>